#ifndef RINGPATTERNMANAGER_H
#define RINGPATTERNMANAGER_H
#include <QtGui>
#include <qtopia/qtopiaapplication.h>
#include <QValueSpaceObject>
#include <QValueSpaceItem>
#include <QTime>
#include "devicemanager.h"


class RingPatternManager : public QObject
{
    Q_OBJECT

    public:	
		enum Device {VIBRATION, LED};
		enum COLOUR {BLUE, ORG, RED};
        RingPatternManager();
        ~RingPatternManager();
		void addPattern(QString filePath, Device device);
		void addVibrationPattern(QString patternName);
		void addLedPattern(QString patternName);
		void setPattern(QString patternName, Device device);
		void playPattern();
		void startVibrate();
		void stopVibrate();
		QList<int> getRandomPattern();
		QList<int> getPulsePattern();
		void setSync(int sync);
       
    private:
		QMap<QString, QList<int> > vibList;
		QMap<QString, QList<int> > ledList;
		QValueSpaceObject *valueSpace;
		DeviceManager *vibrationManager;
		DeviceManager *redLedManager;
		DeviceManager *blueLedManager;
		DeviceManager *orgLedManager;
		int sync;
		int deviceCount;

		QList<int> getLedPattern(QList<int> pattern, COLOUR colour);

	signals:
		void completeSignal();
		void vibrationSignal(bool pos, int id);

	public slots:
		void terminationListener();
		void vibrationListener(bool pos, int id);
};

#endif
